package com.ruoyi.system.service.assets.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.assets.FzBuildingUnit;
import com.ruoyi.system.mapper.assets.FzBuildingUnitMapper;
import com.ruoyi.system.service.assets.IFzBuildingUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 单元信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-02-28
 */
@Service
public class FzBuildingUnitServiceImpl implements IFzBuildingUnitService
{
    @Autowired
    private FzBuildingUnitMapper fzBuildingUnitMapper;

    /**
     * 查询单元信息
     * 
     * @param unitId 单元信息ID
     * @return 单元信息
     */
    @Override
    public FzBuildingUnit selectFzBuildingUnitById(String unitId)
    {
        return fzBuildingUnitMapper.selectFzBuildingUnitById(unitId);
    }

    /**
     * 查询单元信息列表
     * 
     * @param fzBuildingUnit 单元信息
     * @return 单元信息
     */
    @Override
    public List<FzBuildingUnit> selectFzBuildingUnitList(FzBuildingUnit fzBuildingUnit)
    {
        return fzBuildingUnitMapper.selectFzBuildingUnitList(fzBuildingUnit);
    }

    /**
     * 新增单元信息
     * 
     * @param fzBuildingUnit 单元信息
     * @return 结果
     */
    @Override
    public int insertFzBuildingUnit(FzBuildingUnit fzBuildingUnit)
    {
        fzBuildingUnit.setCreateTime(DateUtils.getNowDate());
        return fzBuildingUnitMapper.insertFzBuildingUnit(fzBuildingUnit);
    }

    /**
     * 修改单元信息
     * 
     * @param fzBuildingUnit 单元信息
     * @return 结果
     */
    @Override
    public int updateFzBuildingUnit(FzBuildingUnit fzBuildingUnit)
    {
        return fzBuildingUnitMapper.updateFzBuildingUnit(fzBuildingUnit);
    }

    /**
     * 删除单元信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzBuildingUnitByIds(String ids)
    {
        return fzBuildingUnitMapper.deleteFzBuildingUnitByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除单元信息信息
     * 
     * @param unitId 单元信息ID
     * @return 结果
     */
    @Override
    public int deleteFzBuildingUnitById(String unitId)
    {
        return fzBuildingUnitMapper.deleteFzBuildingUnitById(unitId);
    }
}
